﻿using Dapper.Contrib.Extensions;
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Gx.Model.Entity
{
    [System.ComponentModel.DataAnnotations.Schema.Table("LK_ZeroWarehouseCostDetail")]
    public class LKZeroWarehouseCostDetail
    {
        [System.ComponentModel.DataAnnotations.Key]
        private int _id;
        /// <summary>
        /// Id
        /// </summary>
        [Column("Id")]
        public int Id
        {
            get
            {
                return _id;
            }
            set { _id = value; }
        }


        private string _contractNo;
        /// <summary>
        /// 合同编号
        /// </summary>
        [Column("ContractNo")]
        public string ContractNo
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_contractNo))
                    _contractNo = string.Empty;
                return _contractNo;
            }
            set { _contractNo = value; }
        }

        private string _billNo;
        /// <summary>
        /// 单据编号
        /// </summary>
        [Column("BillNo")]
        public string BillNo
        {
            get
            {
                if (string.IsNullOrWhiteSpace(_billNo))
                    _billNo = string.Empty;
                return _billNo;
            }
            set { _billNo = value; }
        }


        private System.DateTime _beginTime;
        /// <summary>
        /// 开始时间
        /// </summary>
        [Column("BeginTime")]
        public System.DateTime BeginTime
        {
            get
            {
                if (_beginTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _beginTime;
            }
            set { _beginTime = value; }
        }


        private System.DateTime _endTime;
        /// <summary>
        /// 结束时间
        /// </summary>
        [Column("EndTime")]
        public System.DateTime EndTime
        {
            get
            {
                if (_endTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _endTime;
            }
            set { _endTime = value; }
        }


        private decimal _unitPrice;
        /// <summary>
        /// 单价
        /// </summary>
        [Column("UnitPrice")]
        public decimal UnitPrice
        {
            get
            {
                return _unitPrice;
            }
            set { _unitPrice = value; }
        }


        private int _number;
        /// <summary>
        /// 数量
        /// </summary>
        [Column("Number")]
        public int Number
        {
            get
            {
                return _number;
            }
            set { _number = value; }
        }


        private decimal _totalPrice;
        /// <summary>
        /// 总金额
        /// </summary>
        [Column("TotalPrice")]
        public decimal TotalPrice
        {
            get
            {
                return _totalPrice;
            }
            set { _totalPrice = value; }
        }


        private bool _isBalance;
        /// <summary>
        /// 已结算
        /// </summary>
        [Column("IsBalance")]
        public bool IsBalance
        {
            get
            {
                return _isBalance;
            }
            set { _isBalance = value; }
        }


        private System.DateTime _createTime;
        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("CreateTime")]
        public System.DateTime CreateTime
        {
            get
            {
                if (_createTime == DateTime.MinValue)
                {
                    return DateTime.Parse("1911-01-01");
                }
                return _createTime;
            }
            set { _createTime = value; }
        }


        private bool _isDeleted;
        /// <summary>
        /// 是否删除
        /// </summary>
        [Column("IsDeleted")]
        public bool IsDeleted
        {
            get
            {
                return _isDeleted;
            }
            set { _isDeleted = value; }
        }

        [Computed]
        public int Days { get; set; }
    }
}

